home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Floppyshop 2
/
Floppyshop - 2.zip
/
Floppyshop - 2.iso
/
diskmags
/
3565-4.665
/
dmg-3609
/
news.txt
/
stos5.asc
< prev
next >
Wrap
Text File
|
1989-04-05
|
7KB
|
126 lines
STOS BASIC TUTORIAL - PART FIVE
-------------------------------
Written by Lozian for STEN
This time we are going to concentrate on designing your own drop down or
be pulled down Menu's. For a start, boot up your Copy of STOS and type
in the following lines ...
10 MODE 0:FLASH OFF:KEY OFF
20 MENU$(1) = "Menu No. 1":Rem Any text of your choice between quotes.
30 MENU$(2) = " Menu No. 2":Rem 2nd Menu entry.Spaces to make neat.
Menu$(1) and Menu$(2) sets up the 1st and 2nd Menu on the Menu Bar,but
will do nothing until you give the command in line 59 of MENU ON.
To continue ...
40 MENU$(1,1) = "This is Entry No.1"
50 MENU$(1,2) = "This is Entry No.2"
51 MENU$(2,1) = "This is Entry No.1"
52 MENU$(2,2) = "This is Entry No.2"
We have now set up what is to drop down from the Menu Bar and we can
call it with ...
59 MENU ON 5,1:Rem 1st parameter denotes Border type.(Range 1 to 16.)
2nd parameter denotes 1=drop down or 2=pull down.
Nothing will actually happen here yet that you are aware of,except that
the menu bar will appear on screen but you cannot select from it until
you insert, in your listing, a selection routine as follows .....
60 OPTION = mnbar : CHOICE = mnselect:curs off:Rem 2 variables to take
control of the Menu selection.Curs off MUST be placed here.
70 if OPTION = 1 and CHOICE = 1 then cls:locate 1,10:print "You have
selected Menu No.1,Entry No.1"
80 if OPTION = 1 and CHOICE = 2 then cls:locate 1,11:print "You have
selected Menu No.1,Entry No.2"
90 if OPTION = 2 and CHOICE = 1 then cls:locate 1,10:print "You have
selected Menu No.2,Entry No.1"
95 if OPTION = 2 and CHOICE=2 then cls:locate 1,11:print "You have
selected Menu No.2,Entry No.2"
98 goto 60:Rem Loop to allow you to select.
Run this program and observe what happens ....
You can if you wish use Mode 1 which gives you a wider screen and hence
scope for more Menu's. Once the Menu is set up,Bank 15 is used and so
cannot be used for anything else, unless the Menu's are not required.
Spaces are used in the listings at the equals sign for clarification
and should be left out. If you decide to use Mode 1,remember that you
are restricted with colours.
Quite simple,once you know how,and remember that once the MENU ON
command is called,the Menu will run under interrupt and continue to do
so unless you give the command MENU OFF in a later program line.
The selection process can be cut down by using variables,but in this
tutorial context it makes it easier to follow.
So now that you can set up a Menu Bar try experimenting with all the
various options and see how you get on. Insert colour to brighten it
up and with the experience you gain on the SPRITE editor you can create
some attractive Menu's. You can also use ICON$ in the Menu's.
Now we will move on to say a little about SPRITES which incidentally
also run under interrupt. Obviously I cannot show you how to design a
good Sprite but there are some good examples on the discs supplied.
With a 520 not expanded,memory limitations exist. I found a handy tip
in a magazine to conserve some memory and I suggest you apply it to your
COPY of STOS. VERY IMPORTANT - Load "SPRITE.ACB". Do not load as an
accessory or you will not be able to list it.
With the SPRITE.ACB in memory do a list of line 7015. It should
read 7015 Reserve as work 8,max(16384,min(free,32768)). Change the
32768 to 10000 and save your SPRITE.ACB back to disc. You will now
have more scope for animation etc. within the SPRITE editor. Please
note when you save it back to disk use the name SPRITE.ACB. Then you
can reload it as an accessory. If you are not sure what you are doing,
use a BACKUP of your COPY to experiment with. There is NO substitute
to making BACKUP'S. YOU HAVE BEEN WARNED !!!
Designing a good Sprite relies on your own imagination. So be bold and
experiment,especially with the colours in your design,and you will
discover that the simplest of designs look good. Try out your Sprite
in a short program to get the effect of it.
After your Sprite or Sprites are to your liking,save them to disc with
a name you can identify them with e.g. ROCKETS.MBK and use a .MBK as
a extender. If at a later stage you incorporate these Sprites within
a program and save the program with a .BAS extender,on subsequent re-
loading the Sprites will be available from within STOS and will not
require to be re-loaded from disc. They will occupy BANK 15.
Designing a mouse pointer is relatively easy once you can weave your
way round the Sprite editor. Design a Sprite as normal remembering it
is going to be the mouse pointer. Within STOS there are three different
mouse pointers. Normal is the arrow No.1,next is the hand No.2 and No.
3 is a clockface. These are always available. Try CHANGE MOUSE 2 and
the pointer should change to a hand. So remember if you design your own
mouse pointer, it will become No.4,and any further designs will become
5 or 6 etc. So to change to your own design use CHANGE MOUSE 5 or your
choice. To expand a bit more on this theme, BANK 15 holds the Sprites
and when you use the command to change the mouse pointer, say CHANGE
MOUSE 4, you are actually calling on the first Sprite design in BANK 15.
Therefore CHANGE MOUSE 6 would request Sprite No.3 in the BANK. So in
effect the mouse pointer can be considered as a Sprite.
The importance of using effective names for your .MBK files cannot be
stressed enough. As you may now understand ROCKETS.MBK is obviously
Sprite's while the pointers could be named MOUSES.MBK. You may remember
the files when you are working on them but I can assure you that unless
you have a very good memory, in a few days time you will find it very
difficult to differentiate between the different files, unless a little
thought is applied to their names. Alternatively you could jot down the
names on paper,with notes relavent to what they are.
Next time we will look at the commands to get your Sprites up on the
screen and moving. So get designing and all will become clear. The
STOS manual would be handy if you have got one to refer to. Have fun.
(c) Lozian MCMXC11
Banffshire.